package com.lyy.redis;

import com.lyy.RedisApp;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.test.context.junit4.SpringRunner;

/**
 * @author Liangyaoyun
 */
@RunWith(SpringRunner.class)
@SpringBootTest(classes = RedisApp.class)
public class test {
    @Autowired
    public StringRedisTemplate stringRedisTemplate;

    @Test
    public void api(){
        stringRedisTemplate.opsForValue().set("name","zhaosi");
        System.out.println(stringRedisTemplate.opsForValue().get("name"));
    }
}
